From 0e0f39af2e6585d7b61cf67652cdc0c2b2f06eb8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 18 Jan 2023 19:44:27 -0800 Subject: pots --- .../(app)/invoice/[hash]/tip/+page.server.js | 11 + src/routes/(app)/invoice/[hash]/tip/+page.svelte | 252 +++++++++++++++++++++ 2 files changed, 263 insertions(+) create mode 100644 src/routes/(app)/invoice/[hash]/tip/+page.server.js create mode 100644 src/routes/(app)/invoice/[hash]/tip/+page.svelte (limited to 'src/routes/(app)/invoice/[hash]/tip') diff --git a/src/routes/(app)/invoice/[hash]/tip/+page.server.js b/src/routes/(app)/invoice/[hash]/tip/+page.server.js new file mode 100644 index 00000000..c78e5020 --- /dev/null +++ b/src/routes/(app)/invoice/[hash]/tip/+page.server.js @@ -0,0 +1,11 @@ +import invoice from '$lib/invoice'; +import { redirect } from '@sveltejs/kit'; + +export async function load({ parent }) { + let { invoice } = await parent(); + if (!invoice.amount) throw redirect(307, `/invoice/${invoice.id}`); +} + +export const actions = { + default: invoice +}; diff --git a/src/routes/(app)/invoice/[hash]/tip/+page.svelte b/src/routes/(app)/invoice/[hash]/tip/+page.svelte new file mode 100644 index 00000000..308720ab --- /dev/null +++ b/src/routes/(app)/invoice/[hash]/tip/+page.svelte @@ -0,0 +1,252 @@ + + + + +
+
+ + + + + + + + +

{$t('invoice.addTipq')}

+ {#if !showCustomAmount} +
{Math.round(tipPercent)}%
+ + + +
+
+ + {f(amountFiat, currency)} + +{f(tipAmount, currency)} + +
+ +
+ {sat(amount)} + +{sat(tip)} +
+
+ + {#if tip} +
+ + +
+ {:else} + {#each tipAmounts as amount} + + {/each} + {/if} + +
+ +
+ {/if} + +
+
+ + {/if} + + + -- cgit v1.2.3